<template>
  <div>
    <el-dialog :visible.sync="dialog.search" :close-on-click-modal="false" title="高级搜索" width="80%" append-to-body>
      <el-form ref="searchForm" :model="searchForm" label-width="120px">
        <el-row>
          <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
	<el-form-item label="用户手机号" prop="userPhone" label-for="userPhone">
	<el-input v-model="searchForm.userPhone" element-id="userPhone" placeholder="请输入用户手机号" clearable @keyup.enter.native="searchOkDialog"/>
</el-form-item>
</el-col><el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
	<el-form-item label="用户昵称" prop="userNickname" label-for="userNickname">
	<el-input v-model="searchForm.userNickname" element-id="userNickname" placeholder="请输入用户昵称" clearable @keyup.enter.native="searchOkDialog"/>
</el-form-item>
</el-col><el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
	
	<el-form-item label="用户是否可用" prop="userIsActive">
              <el-select
                v-model="searchForm.userIsActive"
                placeholder="请选择用户是否可用"
                clearable
                style="width: 100%;"
              >
                <el-option
                  v-for="item in selects.userIsActiveSelect"
                  :value="item.value"
                  :key="item.value"
                  :label="item.displayValue"
                ></el-option>
              </el-select>

</el-form-item>
</el-col><el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
	<el-form-item label="店铺标题" prop="shopTitle" label-for="shopTitle">
	<el-input v-model="searchForm.shopTitle" element-id="shopTitle" placeholder="请输入店铺标题" clearable @keyup.enter.native="searchOkDialog"/>
</el-form-item>
</el-col><el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
	<el-form-item label="店铺是否可用" prop="shopIsActive">
              <el-select
                v-model="searchForm.shopIsActive"
                placeholder="请选择店铺是否可用"
                clearable
                style="width: 100%;"
              >
                <el-option
                  v-for="item in selects.shopIsActiveSelect"
                  :value="item.value"
                  :key="item.value"
                  :label="item.displayValue"
                ></el-option>
              </el-select>

</el-form-item>
</el-col><el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
	<el-form-item label="商品标题" prop="goodsTitle" label-for="goodsTitle">
	<el-input v-model="searchForm.goodsTitle" element-id="goodsTitle" placeholder="请输入商品标题" clearable @keyup.enter.native="searchOkDialog"/>
</el-form-item>
</el-col><el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
	<el-form-item label="商品是否可用" prop="goodsIsActive">
              <el-select
                v-model="searchForm.goodsIsActive"
                placeholder="请选择商品是否可用"
                clearable
                style="width: 100%;"
              >
                <el-option
                  v-for="item in selects.goodsIsActiveSelect"
                  :value="item.value"
                  :key="item.value"
                  :label="item.displayValue"
                ></el-option>
              </el-select>

</el-form-item>
</el-col><el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
	<el-form-item label="售卖标题" prop="skuTitle" label-for="skuTitle">
	<el-input v-model="searchForm.skuTitle" element-id="skuTitle" placeholder="请输入售卖标题" clearable @keyup.enter.native="searchOkDialog"/>
</el-form-item>
</el-col><el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
	
	<el-form-item label="SKU是否可用" prop="skuIsActive">
              <el-select
                v-model="searchForm.skuIsActive"
                placeholder="请选择SKU是否可用"
                clearable
                style="width: 100%;"
              >
                <el-option
                  v-for="item in selects.skuIsActiveSelect"
                  :value="item.value"
                  :key="item.value"
                  :label="item.displayValue"
                ></el-option>
              </el-select>

</el-form-item>
</el-col><el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
	<el-form-item label="价格"><el-row>
	<el-col :span="11">
	<el-form-item prop="priceMin">
	<el-input-number v-model="searchForm.priceMin" placeholder="请输入开始价格" style="width: 100%;" @keyup.enter.native="searchOkDialog"/>
</el-form-item>
</el-col>
	<el-col :span="2" style="text-align: center">-</el-col>
	<el-col :span="11">
	<el-form-item prop="priceMax">
	<el-input-number v-model="searchForm.priceMax" placeholder="请输入结束价格" style="width: 100%;" @keyup.enter.native="searchOkDialog"/>
</el-form-item>
</el-col>
</el-row>
</el-form-item>
</el-col><el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
	<el-form-item label="SKU规格信息" prop="skuInfo" label-for="skuInfo">
	<el-input v-model="searchForm.skuInfo" element-id="skuInfo" placeholder="请输入SKU规格信息" clearable @keyup.enter.native="searchOkDialog"/>
</el-form-item>
</el-col><el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
	<el-form-item label="购买数量"><el-row>
	<el-col :span="11">
	<el-form-item prop="quantityMin">
	<el-input-number v-model="searchForm.quantityMin" placeholder="请输入开始购买数量" style="width: 100%;" @keyup.enter.native="searchOkDialog"/>
</el-form-item>
</el-col>
	<el-col :span="2" style="text-align: center">-</el-col>
	<el-col :span="11">
	<el-form-item prop="quantityMax">
	<el-input-number v-model="searchForm.quantityMax" placeholder="请输入结束购买数量" style="width: 100%;" @keyup.enter.native="searchOkDialog"/>
</el-form-item>
</el-col>
</el-row>
</el-form-item>
</el-col><el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
	
	<el-form-item label="评分星级"><el-row>
	<el-col :span="11">
	<el-form-item prop="commentRateMin">
	<el-input-number v-model="searchForm.commentRateMin" placeholder="请输入开始评分星级" style="width: 100%;" @keyup.enter.native="searchOkDialog"/>
</el-form-item>
</el-col>
	<el-col :span="2" style="text-align: center">-</el-col>
	<el-col :span="11">
	<el-form-item prop="commentRateMax">
	<el-input-number v-model="searchForm.commentRateMax" placeholder="请输入结束评分星级" style="width: 100%;" @keyup.enter.native="searchOkDialog"/>
</el-form-item>
</el-col>
</el-row>
</el-form-item>
</el-col><el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
	<el-form-item label="评论详情" prop="comments" label-for="comments">
	<el-input v-model="searchForm.comments" element-id="comments" placeholder="请输入评论详情" clearable @keyup.enter.native="searchOkDialog"/>
</el-form-item>
</el-col><el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
	<el-form-item label="追加评论" prop="appendComment" label-for="appendComment">
	<el-input v-model="searchForm.appendComment" element-id="appendComment" placeholder="请输入追加评论" clearable @keyup.enter.native="searchOkDialog"/>
</el-form-item>
</el-col><el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
	<el-form-item label="回复详情" prop="reply" label-for="reply">
	<el-input v-model="searchForm.reply" element-id="reply" placeholder="请输入回复详情" clearable @keyup.enter.native="searchOkDialog"/>
</el-form-item>
</el-col><el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
	<el-form-item label="置顶状态" prop="stickStatus">
              <el-select
                v-model="searchForm.stickStatus"
                placeholder="请选择置顶状态"
                clearable
                style="width: 100%;"
              >
                <el-option
                  v-for="item in selects.stickStatusSelect"
                  :value="item.value"
                  :key="item.value"
                  :label="item.displayValue"
                ></el-option>
              </el-select>

</el-form-item>
</el-col><el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
	<el-form-item label="版本号"><el-row>
	<el-col :span="11">
	<el-form-item prop="versionMin">
	<el-input-number v-model="searchForm.versionMin" placeholder="请输入开始版本号" style="width: 100%;" @keyup.enter.native="searchOkDialog"/>
</el-form-item>
</el-col>
	<el-col :span="2" style="text-align: center">-</el-col>
	<el-col :span="11">
	<el-form-item prop="versionMax">
	<el-input-number v-model="searchForm.versionMax" placeholder="请输入结束版本号" style="width: 100%;" @keyup.enter.native="searchOkDialog"/>
</el-form-item>
</el-col>
</el-row>
</el-form-item>
</el-col><el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
	<el-form-item label="创建时间"><el-row>
	<el-col :span="11">
	<el-form-item prop="createTimeMin">
	<el-date-picker type="datetime" v-model="searchForm.createTimeMin" placeholder="请输入开始创建时间" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" style="width: 100%;" clearable></el-date-picker>
</el-form-item>
</el-col>
	<el-col :span="2" style="text-align: center">-</el-col>
	<el-col :span="11">
	<el-form-item prop="createTimeMax">
	<el-date-picker type="datetime" v-model="searchForm.createTimeMax" placeholder="请输入结束创建时间" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" style="width: 100%;" clearable></el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form-item>
</el-col><el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
	<el-form-item label="更新时间"><el-row>
	<el-col :span="11">
	<el-form-item prop="updateTimeMin">
	<el-date-picker type="datetime" v-model="searchForm.updateTimeMin" placeholder="请输入开始更新时间" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" style="width: 100%;" clearable></el-date-picker>
</el-form-item>
</el-col>
	<el-col :span="2" style="text-align: center">-</el-col>
	<el-col :span="11">
	<el-form-item prop="updateTimeMax">
	<el-date-picker type="datetime" v-model="searchForm.updateTimeMax" placeholder="请输入结束更新时间" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" style="width: 100%;" clearable></el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form-item>
</el-col><el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
	<el-form-item label="是否可用" prop="isActive">
              <el-select
                v-model="searchForm.isActive"
                placeholder="请选择是否可用"
                clearable
                style="width: 100%;"
              >
                <el-option
                  v-for="item in selects.isActiveSelect"
                  :value="item.value"
                  :key="item.value"
                  :label="item.displayValue"
                ></el-option>
              </el-select>

</el-form-item>
</el-col>
        </el-row>
      </el-form>
      <div slot="footer">
        <el-button @click="cancelDialog">取消</el-button>
        <el-button type="primary" @click="searchOkDialog" :loading="loading.search">搜索</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import * as utils from '@/utils/utils'
import * as ResponseStatus from '@/utils/response-status'
export default {
  name: 'GoodsCommentSearch',
  data() {
    return {
      dialog: {
        search: false
      },
      loading: {
        search: false
      },
      searchForm: {
        pageNo: 1,
        pageSize: 10,
        sortColumn: undefined,
        sortOrder: undefined,
        id: undefined,
idMin: undefined, 
idMax: undefined, 
userId: undefined,
userIdMin: undefined, 
userIdMax: undefined, 
userPhone: undefined,
userNickname: undefined,
userHeadicon: undefined,
userIsActive: undefined,
userIsActiveMin: undefined, 
userIsActiveMax: undefined, 
shopId: undefined,
shopIdMin: undefined, 
shopIdMax: undefined, 
shopTitle: undefined,
shopIsActive: undefined,
shopIsActiveMin: undefined, 
shopIsActiveMax: undefined, 
goodsId: undefined,
goodsIdMin: undefined, 
goodsIdMax: undefined, 
goodsTitle: undefined,
goodsIsActive: undefined,
goodsIsActiveMin: undefined, 
goodsIsActiveMax: undefined, 
goodsSkuId: undefined,
goodsSkuIdMin: undefined, 
goodsSkuIdMax: undefined, 
skuTitle: undefined,
skuPicUrl: undefined,
skuIsActive: undefined,
skuIsActiveMin: undefined, 
skuIsActiveMax: undefined, 
price: undefined,
priceMin: undefined, 
priceMax: undefined, 
skuInfo: undefined,
quantity: undefined,
quantityMin: undefined, 
quantityMax: undefined, 
commentLevel: undefined,
commentLevelMin: undefined, 
commentLevelMax: undefined, 
commentRate: undefined,
commentRateMin: undefined, 
commentRateMax: undefined, 
comments: undefined,
appendComment: undefined,
reply: undefined,
stickStatus: undefined,
stickStatusMin: undefined, 
stickStatusMax: undefined, 
version: undefined,
versionMin: undefined, 
versionMax: undefined, 
createTime: undefined,
createTimeMin: undefined, 
createTimeMax: undefined, 
updateTime: undefined,
updateTimeMin: undefined, 
updateTimeMax: undefined, 
isActive: undefined,
isActiveMin: undefined, 
isActiveMax: undefined, 

      },
      dataDictCodes: ['YES_NO','COMMENT_LEVEL',],
      selects: {
        userIsActiveSelect: [],
shopIsActiveSelect: [],
goodsIsActiveSelect: [],
skuIsActiveSelect: [],
commentLevelSelect: [],
stickStatusSelect: [],
isActiveSelect: [],

      }
    }
  },
  computed: {},
  mounted() {
        this.initDataDict()
    
  },
  methods: {
    initDataDict(){
utils
      .getDataDict(this.dataDictCodes)
      .then(response => {
        if (response) {
          utils.getSelectDictItems({
            mainComponent: this,
            dataDictItems: response,
            dictCode: 'YES_NO',
            formProp: 'userIsActive',
            dataProp: 'userIsActiveSelect'
          })
utils.getSelectDictItems({
            mainComponent: this,
            dataDictItems: response,
            dictCode: 'YES_NO',
            formProp: 'shopIsActive',
            dataProp: 'shopIsActiveSelect'
          })
utils.getSelectDictItems({
            mainComponent: this,
            dataDictItems: response,
            dictCode: 'YES_NO',
            formProp: 'goodsIsActive',
            dataProp: 'goodsIsActiveSelect'
          })
utils.getSelectDictItems({
            mainComponent: this,
            dataDictItems: response,
            dictCode: 'YES_NO',
            formProp: 'skuIsActive',
            dataProp: 'skuIsActiveSelect'
          })
utils.getSelectDictItems({
            mainComponent: this,
            dataDictItems: response,
            dictCode: 'COMMENT_LEVEL',
            formProp: 'commentLevel',
            dataProp: 'commentLevelSelect'
          })
utils.getSelectDictItems({
            mainComponent: this,
            dataDictItems: response,
            dictCode: 'YES_NO',
            formProp: 'stickStatus',
            dataProp: 'stickStatusSelect'
          })
utils.getSelectDictItems({
            mainComponent: this,
            dataDictItems: response,
            dictCode: 'YES_NO',
            formProp: 'isActive',
            dataProp: 'isActiveSelect'
          })

        }
      })
      .catch(error => {
        console.log(error)
      })
    },
    resetForm(excludeProps) {
      for (let key in this.searchForm) {
        if (excludeProps && excludeProps.includes(key)) {
          continue
        }
        this.searchForm[key] = undefined
      }
    },
    cancelDialog() {
      this.dialog.search = false
    },
    searchOkDialog() {
      this.dialog.search = false
      this.$emit('searchTable', true)
    }
  }
}
</script>

<style>
</style>